package com.liu.my_blog_system.utils;

import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class BlogException extends RuntimeException {
    private Integer code;

    public BlogException(Integer code, String message) {
        super(message);
        this.code = code;
    }
    public BlogException( String message) {
        super(message);
        this.code = 20001;
    }

    public BlogException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

}
